1. Field of the Invention
The present invention relates to printer logic. More specifically, the present invention discloses a code strip print head position sensor with error detection and correction.
2. Description of the Prior Art
Accurate positioning of the print head within a printer is essential for ensuring the quality of a print job. Optical detecting systems are frequently used in printers to determine the position of the print head. Please refer to FIG. 1 and FIG. 2. FIG. 1 is a perspective view of a prior art printer 1. FIG. 2 is a function block diagram of the printer 1. The printer 1 comprises a print track 7 aligned along a left-and-right direction within the printer 1, as indicated by arrow RL. A carriage 9 slides along the print track 7, and carries a print cartridge 6. The print cartridge 6 is replaceable, and has a print head 3 that performs the actual printing operation. A driving system 2 moves the carriage 9, and thus the print head 3, left and right along the print track 7. Control circuitry 8 controls the operation of the printer 1, such as controlling the driving system 2 to move the carriage 9 left or right, and instructing the print head 3 to perform a printing operation. The printer 1 also has a print head position sensing system 4. The sensing system 4 sends signals to the control circuitry 8 to enable the control circuitry 8 to determine the position of the print head 3. The sensing system 4 comprises a code strip 4a and an optical detector 4b. The optical detector 4b sends pulses to the control circuitry 8 as the carriage 9 moves left or right. The pulses are based upon sensed regions on the code strip 4a. 
Please refer to FIG. 3. FIG. 3 is a schematic diagram of the sensing system 4 and resultant sensing signals. The code strip 4a, running along the direction RL, is made from a series of alternating opaque regions 4q and transparent regions 4t. The opaque regions 4q and the transparent regions 4t all have a width w. The sensor 4b runs left and right along the code strip 4a, detecting the transparent regions 4t and opaque regions 4q, and comprises two optical sensors 4y and 4z. The optical sensors 4y and 4z both output a first signal (i.e., xe2x80x9chighxe2x80x9d) when they detect a transparent region 4t, and output a second signal (i.e., xe2x80x9clowxe2x80x9d) when they detect an opaque region 4q. The sensors 4y and 4z thus both output a square waveform that can be plotted against the code strip 4a. Waveform 10 corresponds to the output of the sensor 4z against the code strip 4a. Waveform 12 corresponds to the output of the sensor 4y against the code strip 4a. As the sensor 4y is separated from the sensor 4z by half the distance of the width w of the opaque and transparent regions 4q and 4t (i.e., by w/2), the waveforms 10 and 12 are exactly 90xc2x0 out of phase with each other. The waveforms 10 and 12 are XORed together to form a positioning waveform 14. The positioning waveform 14 is used to determine the position of the print head 3, and has twice the effective resolution of the code strip 4a. With each transition of the positioning waveform 14, the control circuitry 8 increments or decrements a counter 8a depending upon the direction of motion of the carriage 6. The counter 8a thus holds a value that tracks the absolute position of the print head 3.
The above design is very effective at tracking the position of the print head 3. Unfortunately, it is not foolproof. Over time, the code strip 4a can become damaged. This damage will cause the sensors 4y and 4z to incorrectly read the code strip 4a, and lead to an incorrect positioning waveform 14. An incorrect positioning waveform 14 leads to an improper printing process, which degrades the overall printing quality of the printer 1.
It is therefore a primary objective of this invention to provide a method and system for generating an error-corrected print head positioning signal.
The present invention, briefly summarized, discloses a method for generating an error-corrected print head positioning signal for a printer. The printer has a print path, a code strip disposed parallel to the print path, a sensor for sensing the code strip, a driving system for moving the sensor along the code strip, a timer, a memory and a position signal generator. The code strip has embedded position information, which the sensor reads. The sensor generates a first or a second code signal depending upon the position of the sensor on the code strip. The timer generates clock signals at a rate that corresponds to an expected rate of change of the first and second signals from the sensor when the driving system moves the sensor along the code strip. The memory is used to hold the locations of defective areas on the code strip. The position signal generator uses the sensor to generate a position signal when the sensor is not reading within any of the defective areas on the code strip, and uses the clock signals from the timer to generate the position signal when the sensor is moving within any of the defective areas on the code strip.
It is an advantage of the present invention that by using the clock signals to generate the position signals when the sensor is moving in a defective region of the code strip, the position signal generator ensures that the position signals closely correspond to the actual movement of the sensor along the code strip. When the sensor enters back into non-defective areas of the code strip, the signals from the sensor are then used, which re-synchronizes the position signals with the true position of the sensor on the code strip. The position signal generator thus ensures that a valid position signal is generated, leading to a more accurate printing process.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment, which is illustrated in the various figures and drawings.